<script type="text/javascript">
	 myFunction=function(){
		var colour = Math.round(Math.random()*255)+","+Math.round(Math.random()*255)+","+Math.round(Math.random()*255);
		var ali = document.createElement('li');
		var aspan = document.createElement('span');
		aspan.innerText='随机颜色';
		aspan.style.backgroundColor = "rgb("+colour+")";
		ali.append(aspan);
		document.getElementById('upup').append(ali);
		};
</script>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<body>
<input type="button" value="增加一行，颜色随机" onclick="myFunction()">
<ul id="upup">
	<li><span id="firstLi" style="background-color:rgb(255,132,234)">固定颜色</span></li>
</ul>
</body>
</html>
